﻿@using hc.epm.DataModel.Business;
@using hc.epm.Common;
@using hc.Plat.Common.Extend;
@model Epm_TzTenderingApply

@{
    ViewBag.Title = "发起招标详情";
}

<link href="~/Resource/css/ProjectManagement.css" rel="stylesheet" />

<style>
    .btn-pro {
        width: 15%;
        height: 35px;
        border: none;
        background-color: #666666;
        color: #fff;
    }

    .hideTr {
        display: none;
    }
</style>

<div class="contentData">
    <form class="form-horizontal" id="mainForm">
        <div class="module-div">
            <h4>项目基本信息</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td class="table_title">项目名称：</td>
                        <td class="td-div" colspan="3">
                            <div>@Model.ProjectName</div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">承办部门：</td>
                        <td class="td-div">
                            <div>@Model.UndertakeDepartment</div>
                        </td>
                        <td class="table_title">联系人：</td>
                        <td class="td-div">
                            <div>@Model.UndertakeContacts</div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">联系电话：</td>
                        <td class="td-div">
                            <div>@Model.UndertakeTel</div>
                        </td>
                        <td class="table_title">批复文件或者纪要：</td>
                        <td class="td-div">
                            <div>@Model.ApprovalNo</div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>

        <div class="module-div">
            <h4>招标信息</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td class="table_title">
                            <span>招标名称：</span>
                        </td>
                        <td class="td-div" colspan="3">
                            <div class="form-group">@Model.TenderingName</div>
                        </td>
                    </tr>

                    <tr>
                        <td class="table_title">
                            <span>招标类型：</span>
                        </td>
                        <td class="td-div">
                            <div>@Model.TenderingTypeName</div>
                        </td>
                        <td class="table_title">
                            <span>招标方式：</span>
                        </td>
                        <td class="td-div">
                            <div>@Model.BidName</div>
                            <input type="hidden" id="BidType" name="BidType" value="@Model.BidType" />
                        </td>
                    </tr>

                    <tr>
                        <td class="table_title">
                            <span>资金预算及依据：</span>
                        </td>
                        <td class="td-div">
                            <div class="form-group">@Model.CapitalBudget 万元</div>
                        </td>
                    </tr>

                    <tr>
                        <td class="table_title">
                            <span>项目概述：</span>
                        </td>
                        <td class="td-div" colspan="3">
                            <div class="form-group">@Model.ProjectSummary</div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>

        <div class="module-div">
            <h4>附件信息</h4>
            <table class="datalist fileShow" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody class="fileShow-append">                    
                    <tr class="headtr">
                        <th class="table_title" style="width: 219px;">序号</th>
                        <th class="td-div">附件名称</th>
                        <th class="table_title">附件类型</th>
                        <th class="td-div">操作</th>
                    </tr>
                    @if (Model.TzAttachs != null && Model.TzAttachs.Count() > 0)
                    {
                        foreach (var item in Model.TzAttachs)
                        {

                            <tr id="${obj.GuidId}">
                                <td><span class="font-black">@item.Sort</span></td>
                                <td class="text_lf td-div"><span class="font-black">@item.Name</span></td>
                                <td><span class="font-black">@item.TypeName</span></td>
                                <td class="td-div" style="text-align:center">
                                    <a class="fileDel downloadFile" href="javascript:void(0)" style="color:#337ab7;" data-url="@item.FilePath" data-name="@item.Name" >下载</a>
                                </td>
                            </tr>
                        }
                    }
                </tbody>
            </table>

        </div>

        <div class="layui-form-item  btn-save" style="margin-top:60px;text-align:center;">
            <input type="button" id="Cancel" value="返&nbsp;&nbsp;&nbsp;回" class="layui-btn layui-btn-big " />
        </div>
    </form>
</div>

<script>    
    //根据招标方式是否展示隐藏字段
    if ($('#BidType').val() == "ZBFSJINGZHENG") {
        $(".hideTr").show(100);
    } else {
        $(".hideTr").hide();
    }

    //返回按钮
    $("#Cancel").on("click", function () {
        window.location.href = "/TzTenderingApply/index";
    });

    //下载附件
    $("body").on("click", ".downloadFile", function () {
        var path = $(this).data("url");
        var fileName = $(this).data("name");
        window.location.href = "/Download/DownLoadHB?path=" + path + "&fileName=" + fileName;
    });
</script>